def is_logged_in(request):
    """Check if the user is logged in"""
    return {'is_logged_in': request.user.is_authenticated()}

def get_url(request):
    """Return the URI of the accessed resource"""
    protocol = "http://" # Minus one slash; added on join below
    host = request.get_host()
    site_root = 'blog'
    path = request.get_full_path()
    return {
        'absolute_url': "".join((protocol, host, path)),
        'root_url': protocol + "/".join(( host, site_root)),
        'host_url': "".join((protocol, host))
    }